//现在创建router的方式与vue2.x的版本已经很不同了
import {createRouter, createMemoryHistory, RouteRecordRaw} from 'vue-router';
import Layout from '../components/layout/index.vue';

const routes: RouteRecordRaw[] = [
    {
        path: '/',
        component: Layout,
        redirect: '/map',
        children: [
            {
                path: '/home',
                name: 'home',
                component: ()=> import('../pages/home/index.vue'),
                meta: {
                    title: '首页',
                    icon: '',
                },
            },
            {
                path: '/map',
                name: 'map',
                component: ()=> import('../pages/map/index.vue'),
                meta: {
                    title: '地图页面',
                    icon: '',
                },
            },
            {
                path: '/about',
                name: 'about',
                component: ()=> import('../pages/about/index.vue'),
                meta: {
                    title: '关于本站点',
                    icon: '',
                },
            }
        ]
    },
];

const router = createRouter({
    history: createMemoryHistory(), //替代之前的mode，是必须的
    routes
});
export default router;
